﻿using System;

namespace ExFlash.Tags
{
    public class SymbolClassTag : Tag
    {
        protected int mSwfVersion;

        public UInt16 NumSymbols
        {
            get;
            protected set;
        }

        public AssetData[] Symbols
        {
            get;
            protected set;
        }

        public SymbolClassTag(int len, int version, Int32 offset)
            : base(TagCodes.SymbolClass, len, offset)
        {
            mSwfVersion = version;
        }

        public override void SwfDeserialize(BinaryBitReader reader)
        {
            NumSymbols = reader.ReadUInt16();

            Symbols = new AssetData[NumSymbols];

            for (int i = 0; i < NumSymbols; i++)
            {
                Symbols[i] = new AssetData(mSwfVersion);
                Symbols[i].SwfDeserialize(reader);
            }
        }

        public override void SwfSerialize(byte[] arr, ref int offset)
        {
            throw new NotImplementedException();
        }
    }
}
